package eteam.aps.controller;

import eteam.aps.common.R;
import eteam.aps.common.exceptions.AuthException;
import eteam.aps.common.helper.JsonPage;
import eteam.aps.model.dto.ProtectionOrgDto;
import eteam.aps.model.vo.ProtectionOrgListVo;
import eteam.aps.model.vo.ProtectionOrgVo;
import eteam.aps.model.vo.ProtectionVo;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 保障机构控制器
 *
 * @author WMT
 */
public interface IProtectionOrgController {

    @PostMapping("/po/insert")
    R<Integer> insert(@RequestBody ProtectionOrgDto protectionOrgDto) throws Exception, AuthException;

    @PostMapping("/po/delete/{fId}")
    R<Integer> delete(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/po/update")
    R<Integer> update(@RequestBody ProtectionOrgDto protectionOrgDto) throws Exception, AuthException;

    @PostMapping("/po/selectAll")
    R<JsonPage<ProtectionOrgListVo>> selectAll(
            @RequestParam("fOrgCategory") int fOrgCategory,
            @RequestParam(value = "fOrgCode",required = false) String fOrgCode,
            @RequestParam(value = "fOrgName",required = false) String fOrgName,
            @RequestParam("page") int page,
            @RequestParam("pageSize") int pageSize
    ) throws Exception, AuthException;

    @PostMapping("/po/selectDetails/{fId}")
    R<List<ProtectionOrgVo>> selectDetails(@PathVariable String fId) throws Exception, AuthException;

    @PostMapping("/po/proorglist")
    R<List<ProtectionVo>> selectProOrgList() throws Exception, AuthException;
}
